
from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory  
import os   
def generate_launch_description():
   
    # 获取YAML文件绝对路径  
    config_path = os.path.join(  
        get_package_share_directory('compare_cloud'),  
        'config',  
        'compare.yaml'  
    )  

    # 创建节点配置 
    compare = Node(
            package='compare_cloud',
            executable='compare',
            output='screen',  #配置 std::cout 输出
            name='compare',   #这个一定要和yaml文件第一行对应！
            parameters=[config_path]  # 关键参数注入  
           
    )
   
    return LaunchDescription([compare])
